#!/usr/bin/python

# 函数的基本格式
def printme(str):
    print(str)
    return

# 拷贝，函数内部没法改变值
def changeInt(a):
    a = 10
    return

b = 2
changeInt(b)

# list类型传递是引用
def changeList(myList):
    myList.append([4,5,6])

mylist = [1,2,3]
changeList(mylist)
print(mylist)

# 函数参数顺序不重要
def printPerson(age,name):
    print(age,name)
    return
printPerson(name='lxt',age=18)

# 匿名函数，通过lambda
sum = lambda a,b : a+b
print(sum(1,2))

# return返回
def multy(arg1,arg2):
    res = arg1 * arg2
    return res

print(multy(2,3))